home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / complib / fft3du.z / fft3du
Encoding:
Text File  |  1998-10-30  |  9.3 KB  |  199 lines

  1.  
  2.  
  3.  
  4. ssssccccfffffffftttt3333dddduuuu,,,,ddddzzzzfffffffftttt3333dddduuuu((((3333FFFF))))                                    ssssccccfffffffftttt3333dddduuuu,,,,ddddzzzzfffffffftttt3333dddduuuu((((3333FFFF))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      ssssccccfffffffftttt3333dddduuuu,,,, ddddzzzzfffffffftttt3333dddduuuu ---- 3D, Real to Complex, Direct Fast Fourier Transforms.
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSYYYYSSSS
  12.      _F_o_r_t_r_a_n :
  13.      ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee ssssccccfffffffftttt3333dddduuuu(((( ssssiiiiggggnnnn,,,,nnnn1111,,,,nnnn2222,,,,nnnn3333,,,,aaaarrrrrrrraaaayyyy,,,,llllaaaa1111,,,,llllaaaa2222,,,,ccccooooeeeeffff ))))
  14.            iiiinnnntttteeeeggggeeeerrrr        ssssiiiiggggnnnn,,,, nnnn1111,,,, nnnn2222,,,, nnnn3333,,,, llllaaaa1111,,,, llllaaaa2222
  15.            rrrreeeeaaaallll           aaaarrrrrrrraaaayyyy((((llllaaaa1111,,,,llllaaaa2222,,,,nnnn3333))))
  16.            rrrreeeeaaaallll           ccccooooeeeeffff((((((((nnnn1111++++11115555))))++++2222****((((nnnn2222++++11115555))))++++2222****((((nnnn3333++++11115555))))))))
  17.  
  18.      ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee ddddzzzzfffffffftttt3333dddduuuu(((( ssssiiiiggggnnnn,,,,nnnn1111,,,,nnnn2222,,,,nnnn3333,,,,aaaarrrrrrrraaaayyyy,,,,llllaaaa1111,,,,llllaaaa2222,,,,ccccooooeeeeffff ))))
  19.            iiiinnnntttteeeeggggeeeerrrr        ssssiiiiggggnnnn,,,, nnnn1111,,,, nnnn2222,,,, llllaaaa1111,,,, llllaaaa2222
  20.            rrrreeeeaaaallll****8888         aaaarrrrrrrraaaayyyy((((llllaaaa1111,,,,llllaaaa2222,,,,nnnn3333))))
  21.            rrrreeeeaaaallll****8888         ccccooooeeeeffff((((((((nnnn1111++++11115555))))++++2222****((((nnnn2222++++11115555))))++++2222****((((nnnn3333++++11115555))))))))
  22.  
  23.  
  24.      _C :
  25.      ####iiiinnnncccclllluuuuddddeeee <<<<fffffffftttt....hhhh>>>>
  26.      iiiinnnntttt ssssccccfffffffftttt3333dddduuuu (((( iiiinnnntttt ssssiiiiggggnnnn,,,, iiiinnnntttt nnnn1111,,,, iiiinnnntttt nnnn2222,,,, iiiinnnntttt nnnn3333,,,,
  27.           ffffllllooooaaaatttt ****aaaarrrrrrrraaaayyyy,,,, iiiinnnntttt llllaaaa1111,,,, iiiinnnntttt llllaaaa2222,,,, ffffllllooooaaaatttt ****ccccooooeeeeffff))));;;;
  28.      iiiinnnntttt ddddzzzzfffffffftttt3333dddduuuu (((( iiiinnnntttt ssssiiiiggggnnnn,,,, iiiinnnntttt nnnn1111,,,, iiiinnnntttt nnnn2222,,,, iiiinnnntttt nnnn3333,,,,
  29.           ddddoooouuuubbbblllleeee ****aaaarrrrrrrraaaayyyy,,,, iiiinnnntttt llllaaaa1111,,,, iiiinnnntttt llllaaaa2222,,,, ddddoooouuuubbbblllleeee ****ccccooooeeeeffff))));;;;
  30.  
  31.  
  32. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  33.      ssssccccfffffffftttt3333dddduuuu and ddddzzzzfffffffftttt3333dddduuuu compute in place the complex Fourier transform of
  34.      real 3D sequence of size N1 x N2 x N3.  The value F{j1,j2,j3} of the
  35.      transform of the 3D sequence f{i1,i2,i3} is equal to:
  36.           F{j1,j2,j3}=Sum(W1^(i1*j1)*W2^(i2*j2)*W3^(i3*j3)*f{i1,i2,i3}),
  37.                   for i[123] =0,...,(N[123]-1)
  38.               W[123] = exp( (Sign*2*sqrt(-1)*PI) / N[123] )
  39.  
  40.  
  41. SSSSttttoooorrrraaaaggggeeee
  42.      It is assumed that the (N1 x N2 x N3) 3D sequence is stored along
  43.      dimension N1.  So the index {i+1,j,l} has an offset of 1 element with
  44.      respect to {i,j,l}, and {i,j+1,k} an offset of _l_a_1 elements with respect
  45.      to {i,j,k}, and {i,j,k+1} an offset of (_l_a_1 * _l_a_2) elements with respect
  46.      to {i,j,k}.
  47.      NNNNOOOOTTTTEEEE :::: la1 must be larger (or equal) to 2*((N1+2)/2), and la2 larger (or
  48.      equal) to N2.
  49.  
  50.  
  51. AAAAllllggggoooorrrriiiitttthhhhmmmm
  52.      The real-to-complex Direct 3D Fourier transform is computed with a row-
  53.      column approach.
  54.       - First, N3 2D FFTs real-to-complex of size N1xN2 are evaluated, stride
  55.      = 1
  56.       and leading_dimension=la1.
  57.       - then, N1*N2 FFTs complex-to-complex of size N3 are performed,
  58.      stride=(la1/2)*la2, and leading_dimension=1.
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ssssccccfffffffftttt3333dddduuuu,,,,ddddzzzzfffffffftttt3333dddduuuu((((3333FFFF))))                                    ssssccccfffffffftttt3333dddduuuu,,,,ddddzzzzfffffffftttt3333dddduuuu((((3333FFFF))))
  71.  
  72.  
  73.  
  74.      As the input sequence has real values, only half of the results are
  75.      computed since the sample {(N1-k),l,m} of the real-to-complex transform
  76.      would be the conjugate of the sample {k,l,m}.
  77.      However, some extra space is necessary, and the relation
  78.      (la1>=2*((N1+2)/2)) must hold.
  79.  
  80.  
  81. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  82.      SSSSIIIIGGGGNNNN Integer specifying which sign to be used for the expression of W
  83.      (see above) - must be either +1 or -1.
  84.      Unchanged on exit.
  85.  
  86.      NNNN1111 Integer, the first dimension size of the 3D sequence.       Unchanged
  87.      on exit.
  88.  
  89.      NNNN2222 Integer, the second dimension size of the 3D sequence.       Unchanged
  90.      on exit.
  91.  
  92.      NNNN3333 Integer, the thrid dimension size of the 3D sequence.       Unchanged
  93.      on exit.
  94.  
  95.      AAAARRRRRRRRAAAAYYYY Array containing the samples of the 3D sequence to be transformed.
  96.      On input, the element {i,j,k} of the sequence is stored as A(i,j,k) in
  97.      _F_o_r_t_r_a_n , and A[i+j*la1+k*la1*la2] in _C.      On exit, the array is
  98.      overwritten by its transform.
  99.  
  100.      LLLLAAAA1111 Integer, first leading dimension: increment between the samples of
  101.      two consecutive 1D sub-sequences (e.g between {i,j+1,k} and {i,j,k} ).
  102.           Unchanged on exit.
  103.  
  104.      LLLLAAAA2222 Integer, second leading dimension: number of the 1D sub-sequence
  105.      between two consecutive 2D sub-sequences (e.g between {i,j,k+1} and
  106.      {i,j,k}).       Unchanged on exit.
  107.  
  108.      CCCCOOOOEEEEFFFFFFFF Array of at least ( (N1+15)+2*(N2+15)+2*(N3+15) ) elements.  On
  109.      entry it contains the Sines/Cosines and factorization of N. COEFF needs
  110.      to be initialized with a call to scfft3dui or dzfft3dui.       Unchanged
  111.      on exit.
  112.  
  113.  
  114. EEEExxxxaaaammmmpppplllleeee ooooffff CCCCaaaalllllllliiiinnnngggg SSSSeeeeqqqquuuueeeennnncccceeee
  115.      3D FFT computed on a real sequence of size 100x64x125. The elements of
  116.      each sequence are stored with increment (stride) 1, the offset between
  117.      the first element of two succesive 1D sub-sequences (first leading
  118.      dimension) is 102, and the number of 1D sub-sequence between two
  119.      succesive 2D sub-sequences (second leading dimension) is 64.
  120.      Note : 102 >= 100+2 , and 64 >= 64.
  121.      _F_o_r_t_r_a_n
  122.           real array(0:102-1,0:64-1,0:125-1)
  123.           real coeff(100+15 + 2*(64+15) + 2*(125+15))
  124.           call scfft3dui( 100, 64, 125, coeff)
  125.           call scfft3du( -1, 100, 64, 125, array, 102, 64, coeff)
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. ssssccccfffffffftttt3333dddduuuu,,,,ddddzzzzfffffffftttt3333dddduuuu((((3333FFFF))))                                    ssssccccfffffffftttt3333dddduuuu,,,,ddddzzzzfffffffftttt3333dddduuuu((((3333FFFF))))
  137.  
  138.  
  139.  
  140.      _C
  141.           #include <fft.h>
  142.           float array[102*64*125], *coeff;
  143.           coeff = scfft3dui( 100, 64, 125, NULL);
  144.           scfft3du( -1, 100, 64, 125, array, 102, 64, coeff)
  145.  
  146. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  147.      fft, scfft3dui, dzfft3dui, csfft3du, zdfft3du
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.